package com.qianfeng.zmt.controller;

import com.qianfeng.entity.vo.JqueryTreeView;
import com.qianfeng.http.Result;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.ArrayList;
import java.util.List;

@Controller
public class IndexController {

    @RequestMapping("index")
    public String toIndex(){
        return "index";
    }

    @RequestMapping("module-list")
    @ResponseBody
    public Result<?> getModuleList(){
        List<JqueryTreeView> jqueryTreeViewList = new ArrayList<>();

        JqueryTreeView goodsView = new JqueryTreeView(1 , "商品推广" , "goods/list");
        JqueryTreeView orderView = new JqueryTreeView(1 , "订单管理" , "order/list");
        jqueryTreeViewList.add(goodsView);
        jqueryTreeViewList.add(orderView);

        return Result.success(jqueryTreeViewList);
    }

}
